#define KERNEL_SIZE 9
precision mediump float;
uniform sampler2D uSampler;
uniform float uKernel[KERNEL_SIZE];
uniform vec2 uTexOffset[KERNEL_SIZE];
uniform float uColorOffset;
varying vec2 vTexCoord;

void main() {
    vec4 sum = vec4(0.0);
    for (int i=0;i<KERNEL_SIZE;i++) {
        vec4 tc = texture2D(uSampler, vTexCoord+uTexOffset[i]);
        sum += tc * uKernel[i];
    }
    sum += uColorOffset;
    gl_FragColor =sum;
}